package com.kerbores.sso.dao.impl;

import org.nutz.ioc.loader.annotation.IocBean;

import com.kerbores.mongo.EntityMapping;
import com.kerbores.mongo.SimpleEntityMapping;
import com.kerbores.mongo.dao.MongoDao;
import com.kerbores.mongo.utils.Mongos;
import com.kerbores.sso.bean.Token;
import com.kerbores.sso.dao.ITokenDao;
import com.mongodb.DBCollection;

/**
 * @author Ixion
 *
 *         create at 2014年9月3日
 */
@IocBean(name = "tokenDao")
public class TokenDaoImpl extends MongoDao<Token> implements ITokenDao {

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.kerbores.mongo.dao.MongoDao#getMapping()
	 */
	@Override
	protected EntityMapping<Token> getMapping() {
		return new SimpleEntityMapping<Token>(Token.class);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.kerbores.mongo.dao.MongoDao#getCollection()
	 */
	@Override
	protected DBCollection getCollection() {
		return Mongos.getCollection(Token.class);
	}

}
